//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.ruoyi.common.utils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

public final class RequestContext implements RequestAttributes {
    private final RequestAttributes requestAttributes;

    public RequestContext(RequestAttributes requestAttributes) {
        this.requestAttributes = requestAttributes;
    }

    public HttpServletRequest getRequest() {
        return this.requestAttributes instanceof ServletRequestAttributes ? ((ServletRequestAttributes)this.requestAttributes).getRequest() : null;
    }

    public HttpServletResponse getResponse() {
        return this.requestAttributes instanceof ServletRequestAttributes ? ((ServletRequestAttributes)this.requestAttributes).getResponse() : null;
    }

    public static RequestContext currentInstance() throws IllegalStateException {
        return new RequestContext(RequestContextHolder.currentRequestAttributes());
    }

    public Object getAttribute(String arg0, int arg1) {
        return this.requestAttributes.getAttribute(arg0, arg1);
    }

    public void setAttribute(String arg0, Object arg1, int arg2) {
        this.requestAttributes.setAttribute(arg0, arg1, arg2);
    }

    public void removeAttribute(String arg0, int arg1) {
        this.requestAttributes.removeAttribute(arg0, arg1);
    }

    public String[] getAttributeNames(int arg0) {
        return this.requestAttributes.getAttributeNames(arg0);
    }

    public void registerDestructionCallback(String arg0, Runnable arg1, int arg2) {
        this.requestAttributes.registerDestructionCallback(arg0, arg1, arg2);
    }

    public Object resolveReference(String arg0) {
        return this.requestAttributes.resolveReference(arg0);
    }

    public String getSessionId() {
        return this.requestAttributes.getSessionId();
    }

    public Object getSessionMutex() {
        return this.requestAttributes.getSessionMutex();
    }
}
